<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="../vue@3.2.23.js"></script>
	</head>
	<body>
		<div id="app">
			<Counter v-if="sum < 25" @click="doSum()"></Counter>
		</div>
	</body>
</html>
<script>
	//什么是组件
	//怎么创建组件：1.全局组件 2.局部组件
	const {creatApp} = Vue;
	//局部组件
	const Counter = {
		data(){
			return{
				count:0
			}
		},
		template:`<div @click="count++">{{count}}</div>`
	}
	
	const Message = {
		//注册组件
		components:{
			Counter
		}
		data(){
			return{
				message:""
			}
		},
		template:`<div @click="count++">{{count}}</div>`
	}
	
	const TipInfo = {
	   template:`<div>提示信息</div>`
	}
	const app = creatApp({
		components:{
			TipInfo
		},
		data(){
			return{
				
			}
		}
	})
		const vm = app.mount("#app")
</script>